class testPlugin {
  apply(compiler) {
    compiler.plugin('emit', (compilation, callback) => {
      let filelist = 'is in build\n'
      
      for(let filename in compilation.assets){
        filelist += `- ${filename}\n`
      }
      console.log(filelist)
      compilation.assets['filelist.md'] = {
        source(){
          return filelist
        },
        size(){
          return filelist.length
        }
      }

      callback()
    })
  }
}

module.exports = testPlugin